<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>属性的枚举</title>
</head>
<body>
    

    <script>
    
        function Fn (name,age) {
            this.name = name;
            this.age = age;
        }

        Fn.prototype = {
            constuctor: Fn,
            job: function () {
                console.log('job');
            },
            gender: function () {
                console.log('gender');
            }
        };

        let f = new Fn('ws',27);

        for (const key in f) {
            console.log(key); 
      // name
      //age
      //constuctor
      //job
      //gender
        }

        console.log(Object.keys(f));// -> ["name", "age"]
        console.log(JSON.stringify(f)); // -> {"name":"ws","age":27}
        
    </script>

</body>
</html>